/**
 * Created by zdx on 2016/8/26 0026.
 */


require.config({
    baseUrl:'../script/',
    //waitSeconds: 7,
    paths: {
        "jquery": "plugins/jquery-2.2.3.min",
        "bootstrap": "plugins/bootstrap/js/bootstrap.min",
        "slimscroll": "plugins/jquery.slimscroll.min",
        "fastclick": "plugins/fastclick.min",
        "datatables": "plugins/jquery.dataTables",
        "dataTableB": "plugins/dataTables.bootstrap",
        "select2":"plugins/select2.full.min",
        "app": "app.min",
        "additionalmethods":"plugins/additional-methods",
        "validate":"plugins/jquery.validate",
        "coordtransform":"plugins/coordtransform",
        "datetimepicker":"plugins/bootstrap-datetimepicker",
        "jqconfirm":"plugins/jquery-confirm",
        /*"daterangepicker":"plugins/daterangepicker",
        "datepicker":"plugins/bootstrap-datepicker",
        "timepicker":"plugins/bootstrap-timepicker",*/
        "moment":"plugins/moment",
        "rangeSlider":"plugins/ion.rangeSlider.min",




        "baidu":"http://api.map.baidu.com/getscript?v=2.0&ak=j9rX4VOBPikrqZPRWh5Z3dEzPklXLzpD&services=",
        "google": "http://ditu.google.cn/maps/api/js?language=zh-CN&libraries=geometry,drawing&key=AIzaSyDEK4XKx_F2_R76kuxE_igcWbZpu1n14BQ&sensor=false",
        "amap":"http://webapi.amap.com/maps?v=1.3&key=3d03b021648c7b3f6de1e4a00dd6881c",
        "controller":"libs/controller",
        "mapController":"libs/mapcontroller",
        "plantController":"libs/plantcontroller",
        "bdMap":"libs/bdmap",
        "gdMap":"libs/amap",
        "googleMap":"libs/googlemap",
        "info":"libs/info",
        "servies":"libs/servies",
        "rights":"libs/rights",
        "moniter":"libs/moniter",
        "playback":"libs/playback",

        //用户管理
        "customerIndex":"customer/index",
        //监视
        "moniterIndex":"moniter/index",
        //回放
        "wstrackIndex":"wstrack/index",
        "index":"index",
        // 飞行员
        "pilotIndex":"pilot/index",
        // 通航公司
        "companyIndex":"company/index",
        // 飞行器
        "aircraftIndex":"aircraft/index",
        // 设备管理
        "deviceIndex":"device/index",
        // 飞行要素
        "elementIndex":"element/index",
        // 飞行要素地图展示
        "mapview":"element/mapview",
        // 空域航线
        "spacelineIndex":"spaceline/index",
        // 飞行计划
        "plansIndex":"plans/index",
        "plancheckIndex":"plans/plancheck"
    },
    shim:{
        "app":["jquery","bootstrap","slimscroll"],
        "slimscroll":["jquery"],
        "controller":["jquery"],
        "bootstrap":["jquery"],
        "mapController":["google"],
        "jqconfirm":["jquery"],
        "datetimepicker":["jquery"]

    }
});

/*(function(){
 var _9203 = setInterval(parse,10);
 function parse(){
 if($.parser && $.fn.slider && !window.renderedFlag){
 clearInterval(_9203);
 $.parser.parse();
 window.renderedFlag = true;
 }
 }
 })();*/
//alert($('.easyui-datagrid').html());
/*
require(["jquery","bootstrap","slimscroll","fastclick","app","controller","validatezh"],function ($) {

    onerror=handleErr;
    function handleErr(msg,url,l)
    {
        var txt=""
        txt="本页中存在错误。\n\n"
        txt+="错误：" + msg + "\n"
        txt+="URL: " + url + "\n"
        txt+="行：" + l + "\n\n"
        txt+="点击“确定”继续。\n\n"
        console.log(txt)
        return true
    }

    var c=require("controller");

    $('.main-sidebar .sidebar-menu').on("click","a:not([href^='#'])",function (e) {
        c.urlLoad({url:$(this).attr('href')});
        return false;
    })
});*/

var a = location.href;
var b = a.split("/");
var c = b.slice(b.length-1, b.length).toString().split(".");
var name= c.slice(0, 1);
if(name=='login'){
    require(["login"],function(login) {
        login.init()
    });
}else if(name=='index'){
    require(["index"],function(index) {
        index.init();
    });
}



